/**
 * $Id: ProductCategory.java 19 2011-06-11 04:06:06Z feigme $
 */
package com.iary.domain.model.product.category;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import com.iary.domain.model.EntitySupport;

public class ProductCategory extends EntitySupport<ProductCategory> implements
		ProductCategoryTree {

	private String name;
	private Integer idx;
	private Set<ProductCategoryTree> catList = new HashSet<ProductCategoryTree>();

	// Needed by Hibernate
	ProductCategory() {

	}
	
	public ProductCategory(String name){
		this.name = name;
	}

	@Override
	public void add(ProductCategoryTree component) {
		catList.add(component);
	}

	@Override
	public Iterator<ProductCategoryTree> getChild(int i) {
		return catList.iterator();
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void remove(ProductCategoryTree component) {
		catList.remove(component);
	}

}
